package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;


/**
 * 库存统计 库存统计对象 查询条件类
 *
 * @author qijian
 * @date 2024-02-28
 */

@Data
@ToString
@TableName("sd_inventory")
public class SdInventoryQuery {

    @WhereType(filed = "id")
    private Long id;

    @WhereType(filed = "work_order_id")
    private Long workOrderId;

    @WhereType(filed = "work_order_id", type = WhereTypeEnum.IN)
    private List<Long> workOrderIds;
    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private Set<Long> ids;
    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private List<Long> idList;
    @WhereType(filed = "fm_process_id")
    private Long fmProcessId;
    @WhereType(filed = "nfc_car_id", type = WhereTypeEnum.LIKE)
    private String nfcCarIdLike;
    @WhereType(filed = "process_name")
    private String processName;
    @WhereType(filed = "item_spec")
    private String itemSpec;
    @WhereType(filed = "item_spec", tableName = "main_item", type = WhereTypeEnum.LIKE)
    private String itemSpecLike;
    @WhereType(filed = "fm_process_sort")
    private Integer fmProcessSort;
    @WhereType(filed = "qty")
    private BigDecimal qty;
    @WhereType(filed = "status")
    private String status;
    @WhereType(filed = "quality_result_id")
    private Long qualityResultId;
    @WhereType(filed = "item_id")
    private Long itemId;
    @WhereType(filed = "item_code")
    private String itemCode;
    @WhereType(filed = "item_code", tableName = "main_item", type = WhereTypeEnum.LIKE)
    private String itemCodeLike;
    @WhereType(filed = "item_units", tableName = "main_item")
    private String itemUnits;
    @WhereType(filed = "item_classify",tableName = "main_item")
    private String itemClassify;
    @WhereType(filed = "item_classify",tableName = "main_item", type = WhereTypeEnum.LIKE)
    private String itemClassifyLike;
    @WhereType(filed = "item_name", tableName = "main_item")
    private String itemName;
    @WhereType(filed = "item_name", tableName = "main_item", type = WhereTypeEnum.LIKE)
    private String itemNameLike;
    @WhereType(filed = "plan_code")
    private String planCode;
    @WhereType(filed = "out_qty")
    private BigDecimal outQty;
    @WhereType(filed = "out_date",type = WhereTypeEnum.BETWEEN)
    private Date[] outDate;
    @WhereType(filed = "circulation_no")
    private String circulationNo;
    @WhereType(filed = "process_id")
    private Long processId;
    @WhereType(filed = "source_code")
    private String sourceCode;
    @WhereType(filed = "actual_head_no")
    private String actualHeadNo;
    @WhereType(filed = "heat_number")
    private String heatNumber;
    @WhereType(filed = "heat_number", type = WhereTypeEnum.LIKE)
    private String heatNumberLike;
    @WhereType(filed = "number")
    private String number;
    @WhereType(filed = "into_qty")
    private BigDecimal intoQty;
    @WhereType(filed = "internal_number")
    private String internalNumber;
    @WhereType(filed = "internal_number", type = WhereTypeEnum.LIKE)
    private String internalNumberLike;
    @WhereType(filed = "dimensional_barcode")
    private String dimensionalBarcode;
    @WhereType(filed = "al_batch_number")
    private String alBatchNumber;
    @WhereType(filed = "internal_number_source")
    private String internalNumberSource;
    @WhereType(filed = "is_feed")
    private Boolean isFeed;
    @WhereType(filed = "is_inventory_examine")
    private Boolean isInventoryExamine;
    @WhereType(filed = "is_welding")
    private Boolean isWelding;
    @WhereType(filed = "fm_store_id")
    private Long fmStoreId;
    @WhereType(filed = "store_name")
    private String storeName;
    @WhereType(filed = "store_location_name")
    private String storeLocationName;
    @WhereType(filed = "ncr_handle_type")
    private String ncrHandleType;
    @WhereType(filed = "is_after_welded")
    private Boolean isAfterWelded;
    @WhereType(filed = "remark")
    private String remark;
    @WhereType(filed = "u8_is_feed")
    private Boolean u8IsFeed;
    @WhereType(filed = "u8_is_not_null")
    private Boolean u8IsNotNull;
    @WhereType(filed = "back_count")
    private Long backCount;
    @WhereType(filed = "u8_can_feed")
    private Boolean u8CanFeed;
    @WhereType(filed = "is_old_welded")
    private Boolean isOldWelded;
    @WhereType(filed = "is_return")
    private Boolean isReturn;
    @WhereType(filed = "return_time",type = WhereTypeEnum.BETWEEN)
    private Date[] returnTime;
    @WhereType(filed = "return_qty")
    private BigDecimal returnQty;
    @WhereType(filed = "return_name")
    private String returnName;

    @WhereType(filed = "status", type = WhereTypeEnum.IN)
    private List<String> statusIn;


    @WhereType(ignore = true)
    private Long parentId;

    @WhereType(filed = "item_id",type =WhereTypeEnum.IN)
    private List<Long> itemIds;

    @WhereType(filed = "status",type =WhereTypeEnum.NEQ)
    private String unStatus;

    @WhereType(filed = "id",func = " qty>ifnull(out_qty,0)")
    private Boolean isCheck;

    @WhereType(filed = "batch_no")
    private String batchNo;

    @WhereType(filed = "batch_no", type = WhereTypeEnum.LIKE)
    private String batchNoLike;

    @WhereType(ignore = true)
    private Long sourceOrderId;

    @ApiModelProperty("采购单号")
    private String contractNumber;

    @ApiModelProperty("采购单号")
    @WhereType(filed = "number", tableName = "purm_purchase_contract", type = WhereTypeEnum.LIKE)
    private String contractNumberLike;

    @ApiModelProperty("收料单号")
    @WhereType(filed = "number", tableName = "purm_purchase_take", type = WhereTypeEnum.LIKE)
    private String takeNumberLike;

    @ApiModelProperty("入库单号")
    private String inboundNumber;

    @ApiModelProperty("入库单号")
    @WhereType(filed = "number", tableName = "im_purchase_inbound", type = WhereTypeEnum.LIKE)
    private String inboundNumberLike;

    @WhereType(filed = "customer_part_number", type = WhereTypeEnum.LIKE)
    @ApiModelProperty("卷批号")
    private String customerPartNumberLike;

    @WhereType(filed = "customer_part_number")
    @ApiModelProperty("卷批号")
    private String customerPartNumber;

    @WhereType(filed = "id",tableName = "main_outsource", type = WhereTypeEnum.EQ)
    private Long outSourceId;

    @WhereType(filed = "STATUS",tableName = "production_outsourcing", type = WhereTypeEnum.EQ)
    private Boolean outsourceStatus;


}
